const Koa = require('koa');
const Router = require('koa-router')
const indexRouter = require('./router/index')
const views = require('koa-views')
const static = require('koa-static')
const path = require('path')

const app = new Koa();


let staticPath = path.join(__dirname,'./public')
let viewsPath=path.join(__dirname,'./views')

app.use(static(staticPath))
app.use(views(viewsPath,{
  extension:'ejs'
}))

var router = new Router();
router.use('/',indexRouter.routes())

app.use(router.routes())

app.listen(3000,()=>{
  console.log('localhost:3000')
})